package work.linruchang.util.bean.wrapper.impl;

import lombok.Data;
import work.linruchang.util.bean.wrapper.BaseWrapper;
import work.linruchang.util.bean.wrapper.HavingWrapper;

/**
 *
 *
 * @author LinRuChang
 * @version 1.0
 * @date 2022/01/18
 * @since 1.8
 **/
@Data
public class HavingWrapperImpl<MasterTable,CurrentTable,T extends BaseWrapper> extends WhereWrapperImpl<MasterTable,T> implements HavingWrapper<MasterTable,CurrentTable,T> {

    T baseWrapper;

    /**
     * 主表
     */
    protected Class<MasterTable> masterTable;

    protected Class<CurrentTable> currentTable;


    public HavingWrapperImpl(T baseWrapper, Class<MasterTable> masterTable, Class<CurrentTable> currentTable) {
        this.baseWrapper = baseWrapper;
        this.masterTable = masterTable;
        this.currentTable = currentTable;
        this.firstTableClazz = (Class<MasterTable>) currentTable;
        this.allTableMap = baseWrapper.getAllTableMap();
        this.havingWhereSqlFragments = baseWrapper.getHavingWhereSqlFragments();
        this.havingWhereSqlParams = baseWrapper.getHavingWhereSqlParams();
        this.havingWhereSqlParamsTypes = baseWrapper.getHavingWhereSqlParamsTypes();
    }



}
